<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<spring:message code="project.application.name" var="tooltipMsg" />
<spring:message code="login.username" var="loginUserName" />
<spring:message code="login.password" var="loginPassword" />
<c:set var="CONTEXT">${pageContext.request.contextPath}</c:set>
<c:set var="images">${pageContext.request.contextPath}/resources/images</c:set>
<spring:message code="member.username" var="usernamePlaceholder"/>
<spring:message code="member.nickname" var="nicknamePlaceholder"/>
<spring:message code="member.password" var="passwordPlaceholder"/>
<spring:message code="member.password_confirm" var="passwordConfirmPlaceholder"/>
<form:form class="form-horizontal" role="form" action="${CONTEXT}/join" method="post" modelAttribute="joinFormModel">
	<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
	<form:input type="hidden" path="company"/>
	<div class="form-group">
		<label for="nickname" class="col-sm-2 control-label"><spring:message code="member.nickname.label"/></label>
		<div class="col-sm-10">
			<form:input type="text" class="form-control" path="nickname"
				placeholder="${nicknamePlaceholder }" required="required" />
		</div>
	</div>
	<div class="form-group">
		<label for="username" class="col-sm-2 control-label"><spring:message code="member.username.label"/></label>
		<div class="col-sm-10">
			<form:input type="email" class="form-control"  path="username"
				placeholder="${usernamePlaceholder }" required="required" />
		</div>
	</div>
	<div class="form-group">
		<label for="password" class="col-sm-2 control-label"><spring:message code="member.password.label"/></label>
		<div class="col-sm-10">
			<form:input type="password" class="form-control" path="password"
				placeholder="${passwordPlaceholder }" required="required" />
		</div>
	</div>
	<div class="form-group">
		<label for="confirmPassword" class="col-sm-2 control-label"><spring:message code="member.password_confirm.label"/></label>
		<div class="col-sm-10">
			<form:input type="password" class="form-control" path="confirmPassword"
				placeholder="${passwordConfirmPlaceholder }" required="required" />
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-10">
			<button type="submit" class="btn btn-success"><spring:message code="button.singup"/></button>
			<button type="button" class="btn btn-default btn_link" data-link="${CONTEXT }/"><spring:message code="button.cancel"/></button>
		</div>
	</div>
	<form:errors path="nickname">
	<script type="text/javascript"><!--
	$(document).ready(function(){
		$("#nickname").parent().parent().addClass("has-error bg-danger");
		$("#nickname").focus();
	});
	//--></script>
	</form:errors>
	<form:errors path="username">
	<script type="text/javascript"><!--
	$(document).ready(function(){
		$("#username").parent().parent().addClass("has-error bg-danger");
		$("#username").focus();
	});
	//--></script>
	</form:errors>
	<form:errors path="password">
	<script type="text/javascript"><!--
	$(document).ready(function(){
		$("#password").parent().parent().addClass("has-error bg-danger");
		$("#password").focus();
	});
	//--></script>
	</form:errors>
	<form:errors path="confirmPassword">
	<script type="text/javascript"><!--
	$(document).ready(function(){
		$("#confirmPassword").parent().parent().addClass("has-error bg-danger");
		$("#confirmPassword").focus();
	});
	//--></script>
	</form:errors>
</form:form>
